package com.smile.frame.api.es.document;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.smile.frame.config.es.constants.EsIndexNameConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;

import java.io.Serializable;

/**
 * product 文档
 *
 * @author LGC
 */
@Data
@Document(indexName = EsIndexNameConstant.PRODUCT_INDEX)
@ApiModel(description = "Product")
public class Product implements Serializable {
    private static final long serialVersionUID = 837620216765101123L;

    @ApiModelProperty(value = "产品ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @ApiModelProperty(value = "产品名称")
    private String name;

    @ApiModelProperty(value = "产品code")
    private String code;

    @ApiModelProperty(value = "产品价格")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long price;

    @ApiModelProperty(value = "产品库存")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long stock;

}